// Evol functions.
// Authors:
//    Qwerty Dragon
//    Reid
// Description:
//    Check if the player have enough place on his inventory to accept new items  with arguments:
//      getarg(even numbers)   item ID,
//      getarg(odd numbers)    number of items,

function	script	inventoryplace	{

    .@argc = getargcount();

    if (.@argc % 2 != 0)
    {
        debugmes "inventoryplace: Wrong argument count.";
        close;
    }

    for (.@i = .@j = 0; .@i < .@argc; .@i += 2)
    {
        setarray .@item[.@j], getarg(.@i);
        setarray .@amount[.@j], getarg(.@i + 1);
        ++.@j;
    }

    if (!checkweight2(.@item, .@amount))
    {
        narrator 1,
            l("It looks like you can't carry anything else for now."),
            l("You should come back when you have some free space.");

        close;
    }

    return true;
}
